package auctionhaus

import grails.test.mixin.TestFor

/**
 * Created by IntelliJ IDEA.
 * User: Todd
 * Date: 2/6/12
 * Time: 8:29 PM
 * To change this template use File | Settings | File Templates.
 */
@TestFor(Bid)
class BidTests extends GroovyTestCase{
    
    void testAmountIsRequired() {
        Bid bid = new Bid()
        assert !bid.validate()
        assert 'nullable' == bid.errors['amount'].code
    }

    //Bid.dateCreated is required, but is tested in BidIntegrationTests

    void testBidderIsRequired() {
        Bid bid = new Bid()
        assert !bid.validate()
        assert 'nullable' == bid.errors['bidder'].code
    }

    void testListingIsRequired() {
        Bid bid = new Bid()
        assert !bid.validate()
        assert 'nullable' == bid.errors['listing'].code
    }
}
